<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="c" uri="jstl"  %>
<jsp:include page="Templates/metas.jsp"/>
<script type="text/javascript">
<!--
function chooseFreq( obj ){
	if( obj.checked == true ){
		document.getElementById("freQ").checked = false;
		document.getElementById("frecM").checked = true;
	}else{
		document.getElementById("freQ").checked = false;
		document.getElementById("frecM").checked = false;
	}
	return true;	
}

function abrir(){
	
	if(document.getElementById( 'promociones' ).checked){
		
		//document.getElementById("paso").value = 2;
		open_dialog();
		//document.getElementById("reg").submit();		
		}
}

function solonumero( obj , permiteDecimal )
{
    cadena = obj.value ;
    permiteDecimales = permiteDecimal ;
    numeroDecimales = 2 ;
    key = ( document.all ) ? event.keyCode:event.which ;
			
    if ( permiteDecimales == 1 )
    {
        dectext = cadena.substring( cadena.indexOf( '.' ) + 1 , cadena.length ) ;
        if ( cadena.indexOf( '.' ) == -1 && cadena.length > 0 && cadena.length < 3 )
        {
            return ( ( key >= 48 && key <= 57 ) || key == 46 ) ;
        }
        else
        {
            if ( dectext.length >= numeroDecimales )
            {
                return ( window.event.keyCode = 0 ) ;
            }
            else
            {
                return ( ( key >= 48 && key <= 57 ) ) ;
            }
        }
    }
			
    else
    {
        return ( ( key >= 48 && key <= 57 ) ) ;
    }
}

//-->
</script>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->
		<!--  #include file="includes/header.asp"  -->
		<jsp:include page="Templates/headerEng.jsp"/>
       
        <section id="container">
        	<!-- icono de chat -->
			<!-- <a href="#" class="ico_chat"><img alt="ico_chat" src="img/ico_chat.png"></a> -->
			<span id="node_chat_njsd" class="ico_chat"></span>
			<!-- / icono de chat -->
        <h1 class="mine_title"><img src="img/shadow_title.png" class="shadow_mineTit">REGISTER</h1>
        	<p class="txt txt_gray">
        		Complete this application to register <span class="txt_red">completely free </span>and obtain your new address in the US
        		<br>
        		Fields with asterisks (<span class="txt_red">*</span>) are important.
        	</p>
        	<br>
        	<!-- AVISOS DE ERROR -->
        	<div align="center" class="txt txt_red">
        		<html:errors/>
        	</div>
        	<c:choose>
        		<c:when test="${ok eq 1}">
        			<div class="txt txt_red" align="center">
        				<h1 style="color:green"><img alt="icoOk" src="img/icoOk.png"> THANKS FOR REGISTER, YOUR DATA HAVE BEEN SENT TO ACCESS YOUR EMAIL.</h1>
        			</div>
        		</c:when>
        		<c:when test="${ok eq 0}">
        			<div class="txt txt_red" align="center">
        				<h1>HA OCURRIDO UN ERROR, VUELVE A INTENTARLO.</h1>
        			</div>
        		</c:when>
        		<c:otherwise></c:otherwise>
        	</c:choose>
        	<br><br>
        	<html:form action="addRegistroEng.do" styleId="reg" focus="nombre" method="post">
        	
        		<div id="placeholder_addregistro"></div>		
				<ul class="cont_forms">
					<li>
						<h2 class="subtitle txt_center txt_red">PERSONAL DATA</h2>
						<table class="table_reg">
							<tr>
								<td width="40%" align="right"><span class="txt_red">*</span>First name:</td>
								<td width="60%">
									<html:text property="nombre" styleId="nombre" styleClass="txt_input" size="26"/>
									<html:hidden property="acc" styleId="acc" value="1"/>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Last name:</td>
								<td><html:text property="apellidos" styleClass="txt_input" size="26"/></td>
							</tr>
							<tr>
								<td align="right">Company:</td>
								<td>
									<html:text property="razonSocial" styleClass="txt_input" size="26"/>
									<br>
									<small>Only office address</small>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>E-mail:</td>
								<td><html:text property="email" styleClass="txt_input" size="26"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Confirm e-mail:</td>
								<td><html:text property="emailConf" styleClass="txt_input" size="26"/></td>
							</tr>
						</table>
					</li>
					
					<li>
						<h2 class="subtitle txt_center txt_red">DELIVERY ADDRESS</h2>
						<table class="table_reg">
							<tr>
								<td  width="40%" align="right"><span class="txt_red">*</span>Consignee to:</td>
								<td  width="60%"><html:text property="consignado" styleClass="txt_input" size="26"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Street name:</td>
								<td><html:text styleClass="txt_input" property="calle" size="26"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Number:</td>
								<td>
									<html:text property="exterior" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="7" size="7"/> <html:text property="interior" styleClass="txt_input" size="7"/>
									<br>
									<small><span class="txt_red">*</span>External</small> &ensp; &emsp; &emsp;<small>Internal</small>
								</td>
							</tr>
							<tr>
								<td align="right">Additional references:</td>
								<td><html:textarea styleClass="txt_input" property="referencias" cols="26" rows="3"/></td>
							</tr>							
							<tr>
								<td align="right"><span class="txt_red">*</span>Zip code:</td>
								<td>
									<html:text property="cp" styleId="cp" styleClass="txt_input" size="12"/> 
									<a href="#" class="btn_cp" onclick="document.getElementById('acc').value='2';document.forms['registroForm'].submit();"><img alt="" src="img/btn_buscarSmallEng.png"></a></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>More address data:</td>
								<td>
									<select name="colonia" id="colonia" class="txt_input size1">
										<option value="">Choose one</option>
										<c:forEach items="${colonias }" var="colonia_val">
											<c:if test="${colonia eq colonia_val }">
												<option selected>${colonia_val}</option>
											</c:if>
											<c:if test="${colonia ne colonia_val }">
												<option>${colonia_val}</option>
											</c:if>
										</c:forEach>
									</select>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>City or province:</td>
								<td>
									<html:text property="ciudadS" styleClass="txt_input" size="26" value="${ciudad }" readonly="true" disabled="true"/>
									<html:hidden property="ciudad" styleId="ciudad" value="${ciudad }"/>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>State:</td>
								<td>
									<html:text property="estadoS" styleClass="txt_input" size="26" value="${estado }" readonly="true" disabled="true"/>
									<html:hidden property="estado" styleId="estado" value="${estado }"/>
								</td>
							</tr>														
						</table>
					</li>
					
					<li class="no_border">
						<h2 class="subtitle txt_center txt_red">TELEPHONES AND PASSWORDS:</h2>
						<table class="table_reg">
							<tr>
								<td width="40%" align="right"><span class="txt_red">*</span>Home phone:</td>
								<td width="10%">
									<html:text property="lada_casa" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="4" size="4"/>
									<small>Area Code</small>
								</td>
								<td  width="50%">
									<html:text property="tel_casa" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="8" size="14"/>
									<br>
									<small>8 digits</small>
								</td>
							</tr>
							<tr>
								<td align="right">Work phone:</td>
								<td>
									<html:text property="lada_oficina" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="4" size="4"/>
									<small>Area Code</small>
								</td>
								<td>
									<html:text property="tel_oficina" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="8" size="14"/>
									<br>
									<small>8 digits</small>
								</td>
							</tr>
							<tr>
								<td align="right">Mobile:</td>
								<td>
									<html:text property="lada_movil" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="3" size="4"/>
									<small>Area Code</small>
								</td>
								<td>
									<html:text property="tel_movil" styleClass="txt_input" onkeypress="return ValidNum(event);" maxlength="8" size="14"/>
									<br>
									<small>8 digits</small>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>User name:</td>
								<td colspan="2"><html:text property="usr" styleClass="txt_input" maxlength="10" size="26"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Password:</td>
								<td colspan="2">
									<html:password property="pwd" styleClass="txt_input" maxlength="10" size="26"/>
									<br>
									<small>Minimum 6 characters</small>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Confirm password:</td>
								<td colspan="2">
									<html:password property="pwdConf" styleClass="txt_input" maxlength="10" size="26"/>
									<br>
									<small>Minimum 6 characters</small>
								</td>
							</tr>
						</table>
					</li>
				</ul>
				<p class="txt_small txt_gray">
					The address enter in this application will be predetermine for the delivery of your orders if you have moved or simply want to
					change the address you can edit  your data by login in to MY REDPOST. 
				</p>
				<hr>
				
				<ul class="cont_forms">
					<li class="large_cont">
						<h2 class="subtitle txt_center txt_red">SERVICES</h2>
						<table class="table_reg">
							<tr>
								<td>
									<span class="txt_red">*</span>Imports and delivery:
									<br>
									<span class="txt_gray">
									<html:radio property="servicio" value="2" /> Express Service
									<br>
									<html:radio property="servicio" value="1"/> Ecoexpress Service
									</span>
								</td>
							</tr>
							<tr>
								<td>																		
									<span class="txt_gray">
									<html:checkbox property="correspondencia" styleId="correspondencia" value="1" onclick="return chooseFreq(this);"/>
									</span>&nbsp;Mail delivery
								</td>
							</tr>
							<tr>
								<td>
									Frequency of mail delivery:
									<br>
									<span class="txt_gray">
									<html:radio property="frecuencia" styleId="freQ" value="Quincenal" /> Biweekly
									<br>
									<html:radio property="frecuencia" styleId="frecM" value="Mensual"/> Monthly
									</span>
								</td>
							</tr>
							<tr>
								<td>
									<span class="txt_gray">
									<html:checkbox property="promociones" styleId="promociones" value="1" onclick="abrir();"/>																		
									</span>&nbsp;								
									&iquest;Do you wish to receive promotions and news?:
								</td>
							</tr>
							<tr>
								<td>
									<span class="txt_gray">
									<c:if test="${seguro eq '1'}">
										<input type="checkbox" name="seguro" id="seguro" checked value="1"/>&nbsp;
									</c:if>
									<c:if test="${seguro ne '1'}">
										<html:checkbox property="seguro" styleId="seguro" value="1"/>&nbsp;
									</c:if>
									</span>
									Optional transportation insurance
									<br>
									<span class="txt_gray">
									(For shipments with a declared value of over USD100.00).
									<br>									
									</span>
									<br>
								</td>
							</tr>
							<tr>
								<td>
									<span class="txt_red">NOTE:</span> <span class="txt_gray">The personal information you have entered are protected by a safe server secure socket layer who codes and encrypts the information to comply with the most strict protocols of security we are backed by our trust seals.</span>
								</td>
							</tr>
						</table>
					</li>
					<li class="bigger_cont no_border large_cont">
						<h2 class="subtitle txt_center txt_red">PAYMENTS FOR SERVICES</h2>
						<table class="table_reg">
							<tr>
								<td colspan="3">
									&iquest;How do you want to process your payments? <!-- <span class="txt_gray">(Puedes completar esta informaci&oacute;n hasta hacer tu primera compra)</span> -->
									<br>
									<span class="txt_gray">
										<html:radio property="fp" styleId="fp" value="Tarjeta"/> Credit and debit card &emsp; &emsp;
										<html:radio property="fp" styleId="fp" value="transferencia"/> Web transfer &emsp; &emsp;
										<html:radio property="fp" styleId="fp" value="deposito"/> Bank deposit &emsp; &emsp;
										<html:radio property="fp" styleId="fp" value="paypal"/> PayPal
									</span>
								</td>
							</tr>
							<!-- Celdas alternas dependiendo la formna de pago -->
							
							<!-- TDC -->
							<tr>
								<td align="right"><span class="txt_red">*</span>Primary accounts holder:</td>
								<td colspan="2"><html:text styleClass="txt_input" property="ntt" styleId="ntt"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Card type:</td>
								<td colspan="2">
									<html:select property="tt" styleId="tt">
										<option value="">Select</option>
										<c:if test="${tt eq 'V'}">
											<option value="V" selected>VISA</option>
										</c:if>
										<c:if test="${tt ne 'V'}">
											<option value="V">VISA</option>
										</c:if>
										<c:if test="${tt eq 'M'}">
											<option value="M" selected>MasterCard</option>
										</c:if>
										<c:if test="${tt ne 'M'}">
											<option value="M">MasterCard</option>
										</c:if>
										<c:if test="${tt eq 'A'}">
											<option value="A" selected>American Expres</option>
										</c:if>
										<c:if test="${tt ne 'A'}">
											<option value="A">American Expres</option>
										</c:if>
									</html:select>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Card number:</td>
								<td colspan="2"><html:password styleClass="txt_input" property="nt" styleId="nt" onkeypress="return ValidNum(event);"/></td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Expiration date:</td>
								<td colspan="2">									
									<html:select property="fvm" styleId="fvm">
										<option value="0">Month</option>
										<c:if test="${fvmSel eq '1'}">
											<option value="01" selected>01</option>
										</c:if>
										<c:if test="${fvmSel ne '1'}">
											<option value="01">01</option>
										</c:if>
										<c:if test="${fvmSel eq '2'}">
											<option value="02" selected>02</option>
										</c:if>
										<c:if test="${fvmSel ne '2'}">
											<option value="02">02</option>
										</c:if>
										<c:if test="${fvmSel eq '3'}">
											<option value="03" selected>03</option>
										</c:if>
										<c:if test="${fvmSel ne '3'}">
											<option value="03">03</option>
										</c:if>
										<c:if test="${fvmSel eq '4'}">
											<option value="04" selected>04</option>
										</c:if>
										<c:if test="${fvmSel ne '4'}">
											<option value="04">04</option>
										</c:if>
										<c:if test="${fvmSel eq '5'}">
											<option value="05" selected>05</option>
										</c:if>
										<c:if test="${fvmSel ne '5'}">
											<option value="05">05</option>
										</c:if>
										<c:if test="${fvmSel eq '6'}">
											<option value="06" selected>06</option>
										</c:if>
										<c:if test="${fvmSel ne '6'}">
											<option value="06">06</option>
										</c:if>
										<c:if test="${fvmSel eq '7'}">
											<option value="07" selected>07</option>
										</c:if>
										<c:if test="${fvmSel ne '7'}">
											<option value="07">07</option>
										</c:if>
										<c:if test="${fvmSel eq '8'}">
											<option value="08" selected>08</option>
										</c:if>
										<c:if test="${fvmSel ne '8'}">
											<option value="08">08</option>
										</c:if>
										<c:if test="${fvmSel eq '9'}">
											<option value="09" selected>09</option>
										</c:if>
										<c:if test="${fvmSel ne '9'}">
											<option value="09">09</option>
										</c:if>
										<c:if test="${fvmSel eq '10'}">
											<option value="10" selected>10</option>
										</c:if>
										<c:if test="${fvmSel ne '10'}">
											<option value="10">10</option>
										</c:if>
										<c:if test="${fvmSel eq '11'}">
											<option value="11" selected>11</option>
										</c:if>
										<c:if test="${fvmSel ne '11'}">
											<option value="11">11</option>
										</c:if>
										<c:if test="${fvmSel eq '12'}">
											<option value="12" selected>12</option>
										</c:if>
										<c:if test="${fvmSel ne '12'}">
											<option value="12">12</option>
										</c:if>
									</html:select>
									<html:select property="fva" styleId="fva">
										<option value="0">Year</option>
										<c:if test="${fvaSel eq '13'}">
											<option value="13" selected>13</option>
										</c:if>
										<c:if test="${fvaSel ne '13'}">
											<option value="13">13</option>
										</c:if>
										<c:if test="${fvaSel eq '14'}">
											<option value="14" selected>14</option>
										</c:if>
										<c:if test="${fvaSel ne '14'}">
											<option value="14">14</option>
										</c:if>
										<c:if test="${fvaSel eq '15'}">
											<option value="15" selected>15</option>
										</c:if>
										<c:if test="${fvaSel ne '15'}">
											<option value="15">15</option>
										</c:if>
										<c:if test="${fvaSel eq '16'}">
											<option value="16" selected>16</option>
										</c:if>
										<c:if test="${fvaSel ne '16'}">
											<option value="16">16</option>
										</c:if>
										<c:if test="${fvaSel eq '17'}">
											<option value="17" selected>17</option>
										</c:if>
										<c:if test="${fvaSel ne '17'}">
											<option value="17">17</option>
										</c:if>
										<c:if test="${fvaSel eq '18'}">
											<option value="18" selected>18</option>
										</c:if>
										<c:if test="${fvaSel ne '18'}">
											<option value="18">18</option>
										</c:if>
										<c:if test="${fvaSel eq '19'}">
											<option value="19" selected>19</option>
										</c:if>
										<c:if test="${fvaSel ne '19'}">
											<option value="19">19</option>
										</c:if>
									</html:select>
								</td>
							</tr>
							<tr>
								<td align="right"><span class="txt_red">*</span>Security code:</td>
								<td colspan="2">
									<c:if test="${cs eq '0' }">
										<input type="password" name="cs" id="cs" value="" onkeypress="return ValidNum(event);" />
									</c:if>
									<c:if test="${cs ne '0' }">
										<input type="password" name="cs" id="cs" value="${cs}" onkeypress="return ValidNum(event);" />
									</c:if>
								</td>
							</tr>
							<tr>
								<td colspan="3">
									&iquest;Do you wish to get a notification when charges go over USD $ 300.00?
									<br>
									<span class="txt_gray">
										<c:if test="${notificacion eq '1' }">
											<input type="radio" name="notificacion" id="notificacion" value="1" checked>
										</c:if>
										<c:if test="${notificacion ne '1' }">
											<input type="radio" name="notificacion" id="notificacion" value="1" >
										</c:if>
											Yes &emsp; &emsp;
										<c:if test="${notificacion eq '1' }">
											<input type="radio" name="notificacion" id="notificacion" value="0" >
										</c:if>
										<c:if test="${notificacion ne '1' }">
											<input type="radio" name="notificacion" id="notificacion" value="0" checked>
										</c:if>
											I do not need a notification I want charges to go in automatically..
									</span>
								</td>
							</tr>
							<tr>
								<td colspan="3">
									Suggestions and comments:
									<br>
									<textarea cols="80" rows="5" class="txt_input" name="comentarios" id="comentarios">${comentarios}</textarea>
								</td>
							</tr>
							<tr>
								<td align="center">
									<a href="aviso.do" class="link_blue fancybox_aviso">Privacy notice</a>
									<br>
									<span class="txt_gray">
									<c:if test="${privacidad eq '1'}">
										<input type="checkbox" name="privacidad" id="privacidad" checked value="1">
									</c:if> 
									<c:if test="${privacidad ne '1'}">
										<input type="checkbox" name="privacidad" id="privacidad" value="1">
									</c:if>  
									I have read the privacy notice</span>
								</td>
								<td align="center">
									<a href="terminos.do" class="link_blue fancybox_aviso">See terms and conditions</a>
									<br>
									<span class="txt_gray">
									<c:if test="${condiciones eq '1'}">
										<input type="checkbox" name="condiciones" id="condiciones" checked value="1">
									</c:if> 
									<c:if test="${condiciones ne '1'}">
										<input type="checkbox" name="condiciones" id="condiciones" value="1">
									</c:if>   
									I agree with the conditions and terms</span>
								</td>
								<td align="right">
									<input type="image" src="img/btn_enviarRegEng.png">
								</td>
							</tr>
						</table>
					</li>
				</ul>
        	</html:form>
        </section>
        

<jsp:include page="Templates/footerEng.jsp"/>
					<script type="text/javascript">           
			             function ValidCar(evt){
			            	 	if(window.event){ // IE
			            	 		key = evt.keyCode;
			            		 }else{
			            			 key = evt.which;
			            		 }
			            	 	
			                    if ( (key >= 48 && key <= 57) || key == 46 ){
				                    return false;
				                }else{
					                return true;
					            }
			             }
						
						$("#ntt").attr("onkeypress","return ValidCar(event)");
			        </script>